package com.itheima.web.controller;

import com.itheima.domain.Banner;
import com.itheima.domain.Movies;
import com.itheima.service.BannerService;
import com.itheima.service.MoviesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class IndexController {

   @Autowired
    BannerService bannerService;

    /**
     *  查询首页轮播图广告数据
     * @return
     */
    @GetMapping("/banner/findBannerList")
    public List<Banner> findBannerList(){
      return bannerService.findBannerList();
    }


    @Autowired
    MoviesService moviesService;
    /*
    查询影视列表数据
     */
    @GetMapping("/banner/findMoviesMaps")
    public Map<String,List<Movies>> findMoviesMap(){
     return   moviesService.findMoviesMap();
    }
}
